/*
 * userinfo.h
 *
 *  Created on: 2013-2-6
 *      Author: panqiuhui
 */

#ifndef USERINFO_H_
#define USERINFO_H_

#define USERNAME_LEN 30
#define PASSWORD_LEN 20
#define MY_NAME_LEN 45
#define GENDER_LEN 10
#define BIRTHDAY_LEN 11
#define COUNTRY_LEN 45
#define CREDIT_TYPE_LEN 45
#define CREDIT_ID_LEN 45
#define MOBILE_PHONE_NUM_LEN 45
#define FIXED_PHONE_NUM_LEN 45
#define EMAIL_LEN 45
#define ADDRESS_LEN 45
#define POSTCODE_LEN 45
#define TYPE_LEN 10
#define MANAGER "manager"

enum {
	TYPE_EDIT_PERSONAL_INFO, TYPE_REGISTER, TYPE_CHANGE_PASSWORD,
};

struct login_request {
	char username[USERNAME_LEN];
	char password[PASSWORD_LEN];
};

struct userinfo {
	char username[USERNAME_LEN];
	char password[PASSWORD_LEN];
	char name[MY_NAME_LEN];
	char gender[GENDER_LEN];
	char birthday[BIRTHDAY_LEN];
	char country[COUNTRY_LEN];
	char creditType[CREDIT_TYPE_LEN];
	char creditID[CREDIT_ID_LEN];
	char mobilephoneNum[MOBILE_PHONE_NUM_LEN];
	char fixedphoneNum[FIXED_PHONE_NUM_LEN];
	char email[EMAIL_LEN];
	char address[ADDRESS_LEN];
	char postcode[POSTCODE_LEN];
	char type[TYPE_LEN];
};

struct request_type {
	int type;
};

struct userinfo_request {
	struct userinfo user;
};

struct change_pw_request {
	char username[USERNAME_LEN];
	char original_pw[PASSWORD_LEN];
	char new_pw[PASSWORD_LEN];
};

#endif /* USERINFO_H_ */
